#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 

// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2, M3, ect
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);

void setup() {
  Serial.begin(9600);
  Serial.println("Begin motor test.");
  AFMS.begin();  // create with the default frequency 1.6KHz
  uint8_t i;
}

void loop() {  
  // speed: 0-255, 255 is max (204 is 80% max)
  myMotor->run(FORWARD);
  myMotor->setSpeed(204);
  /*myOtherMotor->run(FORWARD);
  myOtherMotor->setSpeed)204);*/
  delay(2000);
  
  myMotor->run(BACKWARD);
  myMotor->setSpeed(204);
  /*myOtherMotor->run(BACKWARD);
  myOtherMotor->setSpeed(204);*/
  delay(2000);
  
  myMotor->run(RELEASE);
  /*myOtherMotor->run(RELEASE);*/
  delay(2000);
}
